package com.shujia.uerService;

import com.shujia.Dao.StuentDao;
import com.shujia.user.Student;

import java.util.HashMap;

public class StudentService {
    private HashMap<String, Student> cache = new HashMap<>();
    public Student QueryStudentById(String id){
        Student student1 = cache.get(id);
        if(student1!=null){
            return student1;
        }
        Student student =  new StuentDao().QueryStudentById(id);
        cache.put(id,student);
        return student;
    }
}
